{% extends 'homepage.html' %}

{% block content %}

<script type="text/javascript" src="{{ url_for('.static', filename='elliptic_modular_form_util-functions.js') }}"></script>
<script type="text/javascript" src="{{ url_for('.static', filename='elliptic_modular_form_scripts.js') }}"></script>


<script>
$(document).ready( function() {
$("#wait").text("Plot of fundamental domain is loading!");
$("#plot").load(function() {
         $("#wait").text("");
    });
}
);
</script>

<style>
table.ntdata th.colhead {
  text-align: left;
  background: #efe;
  border-bottom: 0;
  border-left: 2px solid #9b9;
}
</style>
{% if error is defined %}

<h1>There was an error in meeting your previous request. Please change parameters.</h1>

<div> 
<h2> Error message: </h2>
{{ error | safe }}
</div>
{% endif %}

{% include 'geometric.html' %}

<h1>{{ KNOWL('mf.elliptic.newform',title='Newforms') }} of
{% if level is defined %}
{{KNOWL('mf.elliptic.level',title='level')}}
{% if level.min is defined %}
{{ level.min }}-{{ level.max }}
{% else %}
{{ level }}
{% endif %}
{% endif %}
{%if weight is defined and level is defined %} and {% endif %}
{%if weight is defined %}
{{KNOWL('mf.elliptic.weight',title='weight')}}
{% if weight.min is defined %}
{{ weight.min }}-{{ weight.max }}
{% else %}
{{ weight }}
{% endif %}
{% endif %}
</h1>

{% if browse_table is defined %}
{% if browse_table.rows is defined %}
{#{KNOWL('mf.ellipticemf_browse.all.info',title='Write about browsing') }#}
<p>
The table below gives the dimensions of the space of holomorphic
{{ KNOWL('mf.elliptic.newform',title='newform') }}
of specified {{KNOWL('mf.elliptic.level',title='level')}},
{{KNOWL('mf.elliptic.weight',title='weight')}}, and
{% if show_all_characters is defined %}
character.<br>
Here, the characters are numbered in the same way as
in sage: DirichletGroup(N).<br>
{% else %}
trivial character.
{% endif %}
By clicking on an
entry you access information about the forms in the specified space.
</p>
{% set table = browse_table %}
{% set rows = browse_table.rows %}

{% if table.maxRowCount is defined %}
{% set maxRowCount = table.maxRowCount %}
{% endif %}

{% set row_class = cycler('odd', 'even') %}
{% set len = table.col_heads | length %}
{% set wid = 10*len + 20 %}
<table class="ntdata" width="{{wid}}px">
  <thead>
    {% if table.colhead is defined %}
    <tr>
      <th></th>
      <th colspan="{{maxRowCount}}" class="colhead">{{table.colhead}}</th>
    </tr>
    {% endif %}
    <tr>
      <th width="10px" style="border-right:1px solid black">
        {% if table.rowhead is defined %}
        {{ table.rowhead | safe }}
        {% endif %}
      </th>
      {% for ix in table.col_heads  %}
      <th width="10px">
        {{ ix }}
        <!--a href="{{url_for('render_webpage_label',modulus=level,number=ix) }}" style="">{{ix}}</a-->
      </th>
      {% endfor %}
    </tr>
  </thead>
  <tbody>
    {% for row in rows  %}
    <tr class="{{row_class.next() }}">
      <th width="10px" style="background:#afa; border-right: 1px solid black">

        {{ table.row_heads[loop.index-1] }}

      </th>
      {% set rc = row|count %}
      {% for cell in row  %}
      <td align="center" width="0%">
        <a style="" href="{{cell.url}}">{{cell.dim}}</a>
      </td>
      {% endfor %}
      {% if maxRowCount is defined %}
      {% for j in range(rc,maxRowCount) %}
        <td>&nbsp;</td>
      {% endfor %}
      {% endif %}
    </tr>
    {% endfor %}
  </tbody>
</table>
{% endif %}
{% endif %}

{% include 'select_ranges.html'  %}

{% endblock content %}
